<div id="loaderContainer">
    <div id="loader"></div>
</div>
<div id="folderContent">
{if isset($isRoot) && $isRoot == "true"}
    {if $medias|@count gt 0}
    <div id="researchCategoryTitle">{icon name="folder.png"} {t}Recently added media{/t}</div>
    {assign var="counter" value=1}
    <ul id="imagesCont">
    {foreach from=$medias item=media}
        <li id="{$media->getLang()|lower}_{$media->getUniqueId()}" class="imageContainer {$counter}">
            <div class="image">
                <table cellpadding="0" cellspacing="0" height="100%" width="100%"><tr><td style="vertical-align: middle;" height="100%" width="100%" align="center" valign="center">
                {if $media->isImage()}
                <img src="{$media->getMceIcon()}" alt="{$media->getLabel()}" title="{$media->getLabel()}" />
                {else}
                {icon name=$media->getIcon()}
                {/if}
                </td></tr></table>
            </div>
        </li>
        {assign var="counter" value=$counter+1}
    {/foreach}
    {/if}
{elseif $medias|@count gt 0}
{assign var="counter" value=1}
<ul id="imagesCont">
{foreach from=$medias item=media}
	<li id="{$media->getLang()|lower}_{$media->getUniqueId()}" class="imageContainer {$counter}">
		<div class="image">                    
            <table cellpadding="0" cellspacing="0" height="100%" width="100%">
                <tr>
                    <td style="vertical-align: middle;" height="100%" width="100%" align="center" valign="center">
                    {if $media->isImage()}
                    <img src="{$media->getMceIcon()}" alt="" title="" />
                    {else}
                    {icon name=$media->getIcon()}
                    {/if}
                    </td>
                </tr>
            </table>
		</div>
	</li>
	{assign var="counter" value=$counter+1}
{/foreach}
</ul>
{else}
    <div class="emptyFolder">
        {icon name="info.png"} {t}This folder is empty{/t}{hasRight rule=medias_Add} - <a href="{$URL_RELATIVE}/bo/#{url route='addMedia' docId=$folder->getUniqueId() docLang=$folder->getLang()|lower}" class="greyButton nyroModal">{t}click here to add media{/t}</a> {t}in this folder{/t}{/hasRight}.
    </div>
{/if}
<div style="clear:both"></div>
</div>
<div style="clear:both"></div>

<div style="display: none" id="nbMedia">{$nbMedia}</div>
<div style="display: none" id="numPage">{$numPage}</div>
<div style="display: none" id="addMediasLink">{url route='addMedia' docId=$folder->getUniqueId() docLang=$folder->getLang()}</div>
<div style="display: none" id="addFolderLink">{url route='addMediaFolder' docId=$folder->getUniqueId() docLang=$folder->getLang()}</div>